<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <p id="pid">hello</p>
    <button id="btn">点击</button>
    <script>
        document.getElementById("btn").addEventListener("click",function () {
                alert("hello");
        })

    </script>
</body>
</html>